# -*- coding: utf-8 -*- 
#
# Description:
#
#  Definiton
#
#
#
# Changes:
#
# 2012-01-10
# Initial Commit
#
#
# Copyright 2010-2012, WyDev Team.
# Author: Polo35 (polo35580@hotmail.fr)
#
# Licenced under Academic Free License version 3.0
# Review WyGui README & LICENSE files for further details.

nname: 111
n 111(None)[return None
]:
	i: 31(), 91()
	o: 

nname: 91
n 91(None)[self.widget.set_color(a=0)
]:
	i: 0(f)
	o: 111()

nname: 31
n 31(None)[not_sel, sel = UIItem._get_images_paths(self, item)
self._selected_widget.load(sel)
self._not_selected_widget.load(not_sel)
]:
	i: 0(t)
	o: 111()

nname: 0
n 0(item is not None)[UIItem.reset(self, item, selected)
]:
	i: 
	o: 31(t), 91(f)

nname: 0
n 0(None)[UIItem.reset(self, item, selected)
if item is not None:
	not_sel, sel = UIItem._get_images_paths(self, item)
	self._selected_widget.load(sel)
	self._not_selected_widget.load(not_sel)
else:
	self.widget.set_color(a=0)
return None
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75b8c0c>}
nname: 0
n 0(None)[img_sel = Image()
img_not_sel = Image()
style = self.style
img_not_sel.resize(*style['icon_size'])
img_sel.resize(*style['selected_icon_size'])
preserve_icon_size = style['preserve_icon_size']
img_sel.set_keep_real_size(preserve_icon_size)
img_not_sel.set_keep_real_size(preserve_icon_size)
return (img_not_sel, img_sel)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75b8dac>}
nname: 95
n 95(None)[self._selected_widget.animate('size', width=w, height=h, duration=duration)
self._not_selected_widget.animate('size', width=w, height=h, duration=duration)
]:
	i: 52(), 75()
	o: 

nname: 75
n 75(None)[w, h = self.style['icon_size']
]:
	i: 43(f)
	o: 95()

nname: 52
n 52(None)[w, h = self.style['selected_icon_size']
]:
	i: 43(t)
	o: 95()

nname: 43
n 43(selected)[duration = 0
]:
	i: 25(), 39()
	o: 52(t), 75(f)

nname: 39
n 39(None)[]:
	i: 0(f)
	o: 43()

nname: 25
n 25(None)[]:
	i: 0(t)
	o: 43()

nname: 0
n 0(animate)[UIItem._set_selected(self, selected, animate)
]:
	i: 
	o: 25(t), 39(f)

nname: 95
n 95(None)[self._selected_widget.animate('size', width=w, height=h, duration=duration)
self._not_selected_widget.animate('size', width=w, height=h, duration=duration)
]:
	i: 0()
	o: 

nname: 0
n 0(None)[UIItem._set_selected(self, selected, animate)
if animate:
	pass
duration = 0
if selected:
	w, h = self.style['selected_icon_size']
else:
	w, h = self.style['icon_size']
]:
	i: 
	o: 95()

nname: 0
n 0(None)[UIItem._set_selected(self, selected, animate)
if animate:
	pass
duration = 0
if selected:
	w, h = self.style['selected_icon_size']
else:
	w, h = self.style['icon_size']
self._selected_widget.animate('size', width=w, height=h, duration=duration)
self._not_selected_widget.animate('size', width=w, height=h, duration=duration)
]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75b8d6c>}
nname: 6
n 6(None)[__slots__ = ['_selected', '_marked', '_position', '_edited', 'widget', 'style', '_not_selected_widget', '_selected_widget']
def reset(self, item, selected, position=None):
	UIItem.reset(self, item, selected)
	if item is not None:
		not_sel, sel = UIItem._get_images_paths(self, item)
		self._selected_widget.load(sel)
		self._not_selected_widget.load(not_sel)
	else:
		self.widget.set_color(a=0)
	return None

def _create(self):
	img_sel = Image()
	img_not_sel = Image()
	style = self.style
	img_not_sel.resize(*style['icon_size'])
	img_sel.resize(*style['selected_icon_size'])
	preserve_icon_size = style['preserve_icon_size']
	img_sel.set_keep_real_size(preserve_icon_size)
	img_not_sel.set_keep_real_size(preserve_icon_size)
	return (img_not_sel, img_sel)

def _set_selected(self, selected, animate=True):
	UIItem._set_selected(self, selected, animate)
	if animate:
		pass
	duration = 0
	if selected:
		w, h = self.style['selected_icon_size']
	else:
		w, h = self.style['icon_size']
	self._selected_widget.animate('size', width=w, height=h, duration=duration)
	self._not_selected_widget.animate('size', width=w, height=h, duration=duration)

]:
	i: 
	o: 

self.nodes: {6: <unpyclib.structure.node instance at 0xb75b830c>}
nname: 0
n 0(None)[from __future__ import absolute_import
from .ui_items import UIItem
from peewee.debug import GET_LOGGER
from wyvas import Image
log = GET_LOGGER(__name__)
class ImageItem(UIItem):
	__slots__ = ['_selected', '_marked', '_position', '_edited', 'widget', 'style', '_not_selected_widget', '_selected_widget']
	def reset(self, item, selected, position=None):
		UIItem.reset(self, item, selected)
		if item is not None:
			not_sel, sel = UIItem._get_images_paths(self, item)
			self._selected_widget.load(sel)
			self._not_selected_widget.load(not_sel)
		else:
			self.widget.set_color(a=0)
		return None

	def _create(self):
		img_sel = Image()
		img_not_sel = Image()
		style = self.style
		img_not_sel.resize(*style['icon_size'])
		img_sel.resize(*style['selected_icon_size'])
		preserve_icon_size = style['preserve_icon_size']
		img_sel.set_keep_real_size(preserve_icon_size)
		img_not_sel.set_keep_real_size(preserve_icon_size)
		return (img_not_sel, img_sel)

	def _set_selected(self, selected, animate=True):
		UIItem._set_selected(self, selected, animate)
		if animate:
			pass
		duration = 0
		if selected:
			w, h = self.style['selected_icon_size']
		else:
			w, h = self.style['icon_size']
		self._selected_widget.animate('size', width=w, height=h, duration=duration)
		self._not_selected_widget.animate('size', width=w, height=h, duration=duration)



]:
	i: 
	o: 

self.nodes: {0: <unpyclib.structure.node instance at 0xb75b38ac>}
from __future__ import absolute_import
from .ui_items import UIItem
from peewee.debug import GET_LOGGER
from wyvas import Image
log = GET_LOGGER(__name__)
class ImageItem(UIItem):
	__slots__ = ['_selected', '_marked', '_position', '_edited', 'widget', 'style', '_not_selected_widget', '_selected_widget']
	def reset(self, item, selected, position=None):
		UIItem.reset(self, item, selected)
		if item is not None:
			not_sel, sel = UIItem._get_images_paths(self, item)
			self._selected_widget.load(sel)
			self._not_selected_widget.load(not_sel)
		else:
			self.widget.set_color(a=0)
		return None

	def _create(self):
		img_sel = Image()
		img_not_sel = Image()
		style = self.style
		img_not_sel.resize(*style['icon_size'])
		img_sel.resize(*style['selected_icon_size'])
		preserve_icon_size = style['preserve_icon_size']
		img_sel.set_keep_real_size(preserve_icon_size)
		img_not_sel.set_keep_real_size(preserve_icon_size)
		return (img_not_sel, img_sel)

	def _set_selected(self, selected, animate=True):
		UIItem._set_selected(self, selected, animate)
		if animate:
			pass
		duration = 0
		if selected:
			w, h = self.style['selected_icon_size']
		else:
			w, h = self.style['icon_size']
		self._selected_widget.animate('size', width=w, height=h, duration=duration)
		self._not_selected_widget.animate('size', width=w, height=h, duration=duration)



